package wangjg.android;

import wangjg.android.common.ui.FloatWindow;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;

public class LoginActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        this.setContentView(R.layout.login);
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.login_titlebar);
        this.init();  
    }
    
    private void init(){
	    Button btn_login=(Button)findViewById(R.id.btn_login);
	    btn_login.setOnClickListener(btn_login_listener);
	    
	    Button btn_reg=(Button)findViewById(R.id.btn_register);
	    btn_reg.setOnClickListener(btn_reg_listener);
    }
    
    private void login(){
    	startActivity(new Intent(LoginActivity.this, BuddyListActivity.class));
    }
    
    private void register(){
    	startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
//    	FloatWindow fw = new FloatWindow(this);
//    	fw.show(new Button(this));
    }
    
	OnClickListener btn_login_listener=new OnClickListener(){
		public void onClick(View v) {
			login();
		}
    };
    
	OnClickListener btn_reg_listener=new OnClickListener(){
		public void onClick(View v) {
			register();
		}
    };
}
